define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");

	var Model = function(){
		this.callParent();
	};

	Model.prototype.leftBtnClick = function(event){
		// 通过Shell显示左边的设置
		justep.Shell.showLeft();
	};

	Model.prototype.rightBtnClick = function(event){		
		/*alert('ok');
		justep.Shell.showRight();*/
		
		var onlineUrl = require.toUrl('./online/online.w');
		this.comp('windowDialog1').open({src:onlineUrl});
	};
	

	//contents 滑动事件
	Model.prototype.contentsActiveChange = function(event){
 		//var array = ['第一页','第二页','第三页'];
		//var index = this.comp("contents").getActiveIndex();
		//alert(this.comp("contents").getActiveIndex())
		//alert(array[index]);
		
		var array = ['爆料','精选'];
		$(this.getElementByXid('indicator')).text(array[this.comp("contents").getActiveIndex()]);
		//this.comp("indicator").text(array[this.comp("contents").getActiveIndex()]);
		//$(".x-titlebar-title").text(array[this.comp("contents").getActiveIndex()]);
		//this.comp("indicator").text(array[this.comp("contents").getActiveIndex()]);
	};


	Model.prototype.getImageUrl = function(url) {
		return require.toUrl(url);
	};
	

	Model.prototype.listTemplateUl1Click = function(event){
		var detailUrl = require.toUrl('../detail/detail.w');
		this.comp('windowDialog1').open({
			src : detailUrl,
			params : {
				n_id : this.comp("baasData1").val('n_id')
			}
		});
	};


	Model.prototype.modelParamsReceive = function(event){
		if(this.params.id){
			alert(this.params.id);
		}
		
	};


	return Model;
});